#include "Rayon.hpp"

#include "Formes/Cone.hpp"

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
  Cone cone( Coord( 0., 0., 3. ), VecteurU( 0., 0., -1. ),  1., 10 );

  cout << "Transformation" << endl << cone.versLocal() << endl;

  Coord A(5., 0., 0.);
  VecteurU v(-1., 0., 0.);
  
  cout << "Sommet " << cone.sommet() << ", axe " << cone.axe()
       << ", ouverture " << cone.tanAlpha() << ", hauteur "
       << cone.hauteur() << endl << endl;

  cout << "*****************************************************************************" << endl;

  cout << "Rayon : origine " << A << ", direction " << v << endl << endl;

  Coord inter( cone.trouveIntersection( Rayon( A, v ) ) );

  cout << "Intersection : " << inter << ", normale : " << cone.normale( inter )
       << endl;
  cout << "*****************************************************************************" << endl;

  inter = cone.trouveIntersection( Rayon( Coord( 0.5, 0., 5.5 ), VecteurU( 0., 0., -1. ) ) );
  cout << "Intersection : " << inter << ", normale : " << cone.normale( inter )
       << endl;
  cout << "*****************************************************************************" << endl;

  return 0;
}
